<!DOCTYPE html>
<html>
<head>
    <title>我的数据</title>
<#include "/common/include_header.ftl">
    <style>
        .chartImg:hover {
            box-shadow: 0 8px 16px 8px #888;
            position: relative;
            top:-12px;
        }

        .chartImg:active {
            box-shadow: 0 5px 12px 5px #888;
            position: relative;
            top:-6px;
        }
    </style>


</head>
<body>

<#include "/common/include_top.ftl">

<div class="layui-container fly-marginTop fly-user-main">

<#include "/common/include_menu.ftl">

    <div class="site-tree-mobile layui-hide">
        <i class="layui-icon">&#xe602;</i>
    </div>
    <div class="site-mobile-shade"></div>

    <div class="site-tree-mobile layui-hide">
        <i class="layui-icon">&#xe602;</i>
    </div>
    <div class="site-mobile-shade"></div>


    <div class="fly-panel fly-panel-user" pad20>


        <fieldset class="layui-elem-field layui-field-title" style="margin-top: 20px;">
            <legend style="font-size: 32px;">我的图表</legend>
        </fieldset>

        <a href="/chart/create">
            <button class="layui-btn" style="float: right;">
                <i class="layui-icon">&#xe608;</i> 创建图表
            </button>
        </a>

        <br>
        <br>
        <br>

        <#--<#list chartInfo as chart>-->
        <#--<fieldset class="layui-elem-field">-->
        <#--<legend>爱好</legend>-->
        <#--<div class="layui-field-box">-->
        <#--你可以在这里放任何内容，比如表单神马的-->
        <#--</div>-->
        <#--</fieldset>-->
        <#--</#list>-->

        <#list chartInfo as chart >
            <div class="layui-col-md4 chartImg" style="margin-top: 12px;padding: 10px;">

                <a href="${chart.id}/info">
                    <img width="275" src="/static/images/chartImg/${chart.pageName}.png">
                </a>
                <input style="display: none;" value="${chart.pageName}">

                <div class="layui-row">
                    <div class="layui-col-md6">
                        <p style="text-align: center;font-weight: bolder;">${chart.title}</p>
                    </div>
                    <div class="layui-col-md6">

                        <div class="layui-btn-group">
                            <a href="/chart/${chart.id}/update" >
                                <button class="layui-btn layui-btn-primary layui-btn-sm">
                                    <i class="layui-icon">&#xe642;</i>
                                </button>
                            </a>
                            <a onclick="deleted('${chart.id}')" >
                                <button  class="layui-btn layui-btn-primary layui-btn-sm">
                                    <i class="layui-icon">&#xe640;</i>
                                </button>
                            </a>
                        </div>
                    </div>
                </div>

            </div>
        </#list>

        <hr>
        <hr>
        <hr>






    </div>
</div>

<script>
    function deleted(chartId) {
        layer.open({
            title: '-'
            , content: '确认删除该数据？'
            , yes: function (layero, index) {
                $.ajax({
                    url: '${basePath}/chart/' + chartId + '/delete',
                    type: 'post',
                    dataType: 'json',
                    success: function (rd) {
                        if (rd.suc) {
                            window.location.href = "${basePath}/chart/list";
                        } else {
                            layer.msg(rd.msg, {icon: 2});
                        }
                    }
                });
            }
        });

    }
</script>




<#include "/common/include_footer.ftl">
<#include "/common/include_js.ftl">
</body>
</html>